package com.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
@TableName("user")
@Data
@NoArgsConstructor
public class User {
    //设置主键生成策略为自增
    @TableId(type= IdType.AUTO)
    private Integer id;
    private String no;
    private String name;
    private String password;
    private Integer age;
    private Integer sex;
    private String phone;
    private Integer roleId;
    //默认驼峰会自动映射为is_valid，所以需要显示表明
    @TableField(value = "isValid")
    private String isValid;

    public User(String no, String name, String password, int age, int sex, String phone, int roleId, String isValid) {
        this.no = no;
        this.name = name;
        this.password = password;
        this.age = age;
        this.sex = sex;
        this.phone = phone;
        this.roleId = roleId;
        this.isValid = isValid;
    }
}
